-
Notifications
You must be signed in to change notification settings - Fork 240
[cxx-interop] Add documentation about inferring SWIFT_SHARED_REFERENCE in c++ inheritance #1078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…E in c++ inheritance
cc @egorzhdan |
CC: @j-hui |
CC: @ravikandhadai |
This patch needs 2 important things to be included:
|
|
||
When a C++ type inherits from a `SWIFT_SHARED_REFERENCE` base type, the Swift compiler automatically infers `SWIFT_SHARED_REFERENCE` annotation for the derived type. | ||
The derived type also gets imported as a reference type, and uses the same `retain` and `release` functions as its base class. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@j-hui I changed some text based on your suggestions but added my flavor as well. How does it look now?
@@ -1255,6 +1255,17 @@ object.doSomething() | |||
// `object` will be released here. | |||
``` | |||
|
|||
### Inference of Shared Reference behaviour in Derived Types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: ### -> ####
including this in PR-1106 |
Adding a sentence in the documentation thatthe foreign-reference annotations are now propagated to inherited C++ types